package com.vhuan.self_discipline_service.controller.auth;

import com.vhuan.self_discipline_service.domain.auth.dto.AuthRequest;
import com.vhuan.self_discipline_service.domain.auth.dto.AuthResponse;
import com.vhuan.self_discipline_service.service.auth.AuthService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "认证服务")
@RestController
@RequestMapping("/auth")
@RequiredArgsConstructor
public class AuthController {

    private final AuthService authService;
    @Operation(summary = "用户登录", description = "用户登录")
    @PostMapping("/login")
    public AuthResponse login(@Parameter(description = "用户登录参数") @RequestBody AuthRequest request) {
        return authService.login(request);
    }

}
